//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package test.classify.面向对象12;

public class person {
    private String name;
    private int age;

    public person() {
    }

    public person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String toString() {
        return "person{name = " + this.name + ", age = " + this.age + "}";
    }

    public void keepPet(Animal a, String something) {
        if (a instanceof Dog dog) {
            int var10001 = this.age;
            System.out.println("年龄为" + var10001 + "岁的" + this.name + "养了一只" + dog.getColor() + "的" + dog.getAge() + "岁的狗");
            dog.eat(something);
            dog.lookHome();
        } else if (a instanceof Cat cat) {
            int var5 = this.age;
            System.out.println("年龄为" + var5 + "岁的" + this.name + "养了一只" + cat.getColor() + "的" + cat.getAge() + "岁的猫");
            cat.eat(something);
            cat.catchMouse();
        }

    }
}
